<?php

class Application_Form_NewProduct extends Zend_Form
{

    public function init()
    {
        /* Form Elements & Other Definitions Here ... */
    	$this->setName('NewProduct');
    	$title=new Zend_Form_Element_Text('product_title');
    	$title->setLabel("商品名称")
    		  ->setRequired(true)
    		  ->addFilter('StripTags')
    		  ->addFilter('StringTrim')
    		  ->addValidator('NotEmpty')
    		  ->addValidator('StringLength',false,array(0,30,'UTF-8'));
    	$url_spell=new Zend_Form_Element_Text('product_url_spell');
    	$url_spell->setLabel("url拼音")
    			  ->addFilter('StripTags')
    		      ->addFilter('StringTrim')
    		      ->addValidator('StringLength',false,array(0,100,'UTF-8'));
    	$key_words=new Zend_Form_Element_Text('product_key_words');
    	$key_words->setLabel("关键词")
    			  ->addFilter('StripTags')
    		      ->addFilter('StringTrim')
    		      ->addValidator('StringLength',false,array(0,50,'UTF-8'));
    	$description=new Zend_Form_Element_Text('product_seo_description');
    	$description->setLabel("概要描述")
    	 		  ->addFilter('StripTags')
    		      ->addFilter('StringTrim')
    		      ->addValidator('StringLength',false,array(0,120,'UTF-8'));
    		      
    	$price=new Zend_Form_Element_Text('product_price');
    	$price->setLabel('价格')->addFilter('StripTags')->addFilter('StringTrim')->addValidator('StringLength',false,array(0,9));

    	$promote_price=new Zend_Form_Element_Text('product_promote_price');
    	$promote_price->setLabel('促销价格')->addFilter('StripTags')->addFilter('StringTrim')->addValidator('StringLength',false,array(0,9));
    	
    	$material_type=new Zend_Form_Element_Radio('product_material_type');
    	$material_type->setLabel('玉石原料')->setMultiOptions(array('0'=>'岫玉','1'=>'黄白老玉','2'=>'青老玉','3'=>'河磨玉','4'=>'甲翠','99'=>'其他'))->setSeparator("");
    		      
    	$use_type=new Zend_Form_Element_Radio('prouct_use_type');
    	$use_type->setLabel('用途及款式')->setMultiOptions(array('0'=>'手镯','1'=>'项坠(吊坠)','2'=>'项链','3'=>'手链','4'=>'手把件','5'=>'摆件','99'=>'其他'))->setSeparator('');
    	
    	$pattern=new Zend_Form_Element_MultiCheckbox('product_pattern');
    	$pattern->setLabel('图案及造型')->setMultiOptions(array('0'=>'观音','1'=>'佛','2'=>'貔貅','3'=>'龙','4'=>'凤','5'=>'花草','6'=>'果实','7'=>'生肖','8'=>'平安扣/怀古','9'=>'路路通','10'=>'财神','11'=>'人物','99'=>'其他'))->setSeparator('');
    	
    	$taobao_link=new Zend_Form_Element_Text('product_taobao_link');
    	$taobao_link->setLabel('淘宝链接')->addFilter('StripTags')->addFilter('StringTrim')
    		      ->addValidator('StringLength',false,array(0,200,'UTF-8'));
    		      
    	$location=new Zend_Form_Element_Radio('product_location');
    	$location->setLabel('商品所在地')->setMultiOptions(array('0'=>'沈阳','1'=>'岫岩','2'=>'鞍山','99'=>'其他'))->setSeparator('');
    	
    	$ship_type=new Zend_Form_Element_Radio('product_ship_type');
    	$ship_type->setLabel('运费')->setMultiOptions(array('0'=>'买家承担运费','1'=>'卖家承担运费'))->setSeparator('');
    	
    	$contact=new Zend_Form_Element_Text('product_contact');
    	$contact->setLabel('联系方式')->addFilter('StripTags')->addFilter('StringTrim')
    		      ->addValidator('StringLength',false,array(0,100,'UTF-8'));
    		      
    	$after_sales=new Zend_Form_Element_MultiCheckbox('product_after_sales');
    	$after_sales->setLabel('售后保障')->setMultiOptions(array('0'=>'7天无条件退货','1'=>'提供发票'))->setSeparator('');
    	
    	$is_certificate=new Zend_Form_Element_Radio('product_is_certificate');
    	$is_certificate->setLabel('是否具有鉴定证书')->setMultiOptions(array('0'=>'有','1'=>'没有'))->setSeparator('');
    	
    	
    	
    	$text_description=new Zend_Form_Element_Textarea('product_text_description');
    	$text_description->setLabel("详细介绍");
    	$submit=new Zend_Form_Element_Submit("提交");
    	
    	$this->addElements(array($title,$url_spell,$key_words,$description,$price,$promote_price,$material_type,$use_type,$pattern,$taobao_link,$location,
    	$ship_type,$contact,$after_sales,$is_certificate,$text_description,$submit));
    }


}

